-
Notifications
You must be signed in to change notification settings - Fork 155
WIP: Update Substreams documentation #760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Substreams allows you to speed up the indexing times of your subgraph. | ||
- Substreams allows you to index non-EVM data (Solana, Injective, Starknet, Vara...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be "Substreams allow you"?
- Substreams allows you to index non-EVM data (Solana, Injective, Starknet, Vara...) | ||
|
||
With Substreams, developers can quickly extract data from different blockchains (Ethereum, BNB, Solana, ect.) and send it to various locations of their choice, such as a Postgres database, a Mongo database, or a Subgraph. Additionally, Substreams packages enable developers to specify which data they want to extract from the blockchain. | ||
This is possible because your subgraph can use a Substreams package as a data source, thus creating a Substreams-powered Subgraph (SpS). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is possible because your subgraph can use a Substreams package as a data source, thus creating a Substreams-powered Subgraph (SpS). | |
This is possible because your subgraph can use a Substreams package as a data source, thus creating a Substreams-powered subgraph. |
According to "The Graph Style Guide", we shouldn't capitalize "subgraph", even in the phrase "Substreams-powered subgraphs".
(@bermchain, should we make that document public, and maybe link to it from the docs' CONTRIBUTING guidelines?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh and I propose removing the acronym because it's not used anywhere else on this page, but maybe it's used somewhere else and I'm not aware?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed @benface with lowercase subgraph and not using the acronym unless it's recurring.
I like the idea of publicizing the style guide in the Docs! Let's do it -- I'll select sections that make sense to share.
Also, re: "Substreams is" vs. "Substreams are" -- I believe it's the former because Substreams is a collective noun for the technology (i.e., powered by Substreams tech, not powered by a Substream).
|
||
With Substreams, developers can quickly extract data from different blockchains (Ethereum, BNB, Solana, ect.) and send it to various locations of their choice, such as a Postgres database, a Mongo database, or a Subgraph. Additionally, Substreams packages enable developers to specify which data they want to extract from the blockchain. | ||
This is possible because your subgraph can use a Substreams package as a data source, thus creating a Substreams-powered Subgraph (SpS). | ||
A Substreams package a binary file that contains all the definitions of the data that you want to extract from the blockchain (similar to the `mapping.ts` file of your subgraph). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Substreams package a binary file that contains all the definitions of the data that you want to extract from the blockchain (similar to the `mapping.ts` file of your subgraph). | |
A Substreams package is a binary file that contains all the definitions of the data that you want to extract from the blockchain (similar to the `mapping.ts` file of your subgraph). |
The following example shows a subgraph manifest (`subgraph.yaml`) that uses a Substreams package as data source, thus receiving the data extracted by the Substreams. | ||
Then, you can use this data in your `mapping.ts` and perform all the transformations needed as a usual subgraph. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following example shows a subgraph manifest (`subgraph.yaml`) that uses a Substreams package as data source, thus receiving the data extracted by the Substreams. | |
Then, you can use this data in your `mapping.ts` and perform all the transformations needed as a usual subgraph. | |
The following example shows a subgraph manifest (`subgraph.yaml`) that uses a Substreams package as data source, thus receiving the data extracted by the Substreams. | |
Then, you can use this data in your `mapping.ts` and perform all the transformations needed as a usual subgraph. |
I'm thinking this is why the Prettier check is failing, but it could be more than one thing. If you're using VS Code, I recommend installing the Prettier extension with "auto-format on save" enabled.
Then, you can use this data in your `mapping.ts` and perform all the transformations needed as a usual subgraph. | ||
|
||
1. **You write a Rust program, which defines the transformations that you want to apply to the blockchain data.** For example, the following Rust function extracts relevant information from an Ethereum block (number, hash, and parent hash). | ||
// example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I just realized this was a WIP; sorry I didn't pay attention to the title. 😅 I'll stop reviewing now unless you want me to continue.
Closing because some of the documentation will live in the SF website. |
No description provided.